attribute vec3 a_VertPosition;
attribute vec2 a_VertTexCoord;
attribute vec3 a_VertNorm;
uniform mat4 u_WVPMatrix;
uniform mat4 u_WMatrix;
varying vec3 v_VertPosition;
varying vec2 v_VertTexCoord;
varying vec3 v_VertNorm;

void main()
{
	vec4 VertPositionL = vec4(a_VertPosition, 1.0);
	vec4 VertNormL = vec4(a_VertNorm, 0.0);
	gl_Position = u_WVPMatrix * VertPositionL;
	
	//calculate world position
	v_VertPosition = vec3((u_WMatrix * VertPositionL).xyz);
	
	//calcualete world normal
	v_VertNorm = vec3((u_WMatrix * VertNormL).xyz);
	
	v_VertTexCoord = a_VertTexCoord;
}